const fs = require('fs');
// 创建输⼊输出流
const rs = fs.createReadStream('./fstext01.txt')
const ws = fs.createWriteStream('./fstextcopy.txt')
// 将原本fstext02.txt内容进行覆盖
// const ws = fs.createWriteStream('./fstext02.txt')
// 把rs复制给ws，并且命名为fstextcopy
rs.pipe(ws);

// ⼆进制友好，图⽚操作
const rs2 = fs.createReadStream('./test01.png')
const ws2 = fs.createWriteStream('./test01copy.png')
// 把rs2复制给ws2，并且命名为test01copy.png
rs2.pipe(ws2);